home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20000824-20010305 / 000154_news@columbia.edu _Thu Dec 28 17:12:35 2000.msg < prev    next >
Internet Message Format  |  2020-01-01  |  4KB

  1. Return-Path: <news@columbia.edu>
  2. Received: from watsun.cc.columbia.edu (watsun.cc.columbia.edu [128.59.39.2])
  3.     by uhaligani.cc.columbia.edu (8.9.3/8.9.3) with ESMTP id RAA14835
  4.     for <kermit.misc@cpunix.cc.columbia.edu>; Thu, 28 Dec 2000 17:12:34 -0500 (EST)
  5. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
  6.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id RAA13267
  7.     for <kermit.misc@watsun.cc.columbia.edu>; Thu, 28 Dec 2000 17:12:34 -0500 (EST)
  8. Received: (from news@localhost)
  9.     by newsmaster.cc.columbia.edu (8.9.3/8.9.3) id RAA01925
  10.     for kermit.misc@watsun.cc.columbia.edu; Thu, 28 Dec 2000 17:03:12 -0500 (EST)
  11. X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
  12. From: jrd@cc.usu.edu (Joe Doupnik)
  13. Subject: Re: A wish for the FTP-client
  14. Message-ID: <5VP2SCqS3328@cc.usu.edu>
  15. Date: 28 Dec 00 14:49:14 MDT
  16. Organization: Utah State University
  17. To: kermit.misc@columbia.edu
  18.  
  19. In article <92g92f$s9j$1@newsmaster.cc.columbia.edu>, fdc@watsun.cc.columbia.edu (Frank da Cruz) writes:
  20. > In article <3A4BA47C.53C64EBA@srv.net>, Kevin Handy  <kth@srv.net> wrote:
  21. > : Frank da Cruz wrote:
  22. > : > ...  How do you convert a
  23. > : > struct tm to a time_t in a reliable way? -- i.e. without writing code to
  24. > : > count days, months, years, leap years, leap seconds, and all the rest,
  25. > : > taking each machine's architecture into account.  I'm sure I must have
  26. > : > overlooked something obvious -- feel free to embarrass me.
  27. > : 
  28. > : Under *nix, I believe the function to use is mktime
  29. > : 
  30. > :     time_t mktime(struct tm *timeptr)
  31. > : 
  32. > 1. The first place I looked (SunOS) doesn't have it.  However, must other
  33. >    UNIX OS's do have it.  But...
  34. > 2. Doesn't do what you want.  "In addition to computing the calendar time,
  35. >    mktime() normalizes  the supplied tm structure" -- applies timezone
  36. >    conversions, etc.  The problem there is, of course, we don't know, and
  37. >    have no way to find out, the server's timezone, and even if we knew it,
  38. >    what the rules are to convert to our own.  The struct tm is *already* in
  39. >    GMT/UTC, and should not be converted to it again.
  40. > Thus the resulting file date won't be what you want.  I think the object
  41. > of copying the server's MDTM is so update can work in both directions.  If
  42. > we use mktime(), I think the result will have up to 24 hours of randomness
  43. > added or subtracted.  Am I missing something?
  44. > - Frank
  45. ---------
  46.     I face this problem daily, at 0300 during mirroring operations. As
  47. Frank notes well, TZ material makes a mess of trying to reproduce UTC stamps
  48. from FTP information. What I do, and what works reasonably well, is use what
  49. FTP itself reports in a LIST command (parse according to remote server
  50. syntax) which is what it thinks the local time/date of the file is. I then
  51. make the client side report the same time/date at user level. This makes
  52. local and remote systems "appear" to yield identical file listings.
  53.     Unix plays a nasty role here were its reporting of time/date varies
  54. with the age of the file, at least as seen in ls -l style listings. Thus
  55. my local files are readjusted to match. The +/- one day ambiguity is just
  56. something to live with. And how do I live with it without re-moving huge
  57. archives? I first restamp time on files with the same name and length, and
  58. only then consider files which differ in name and length. Yes, that is a
  59. compromise subject to errors when the length does not change.
  60.     The bottom line? FTP is designed to talk people to people, not machine
  61. to machine. To do machine to machine work we invoke formal RPC style schemes,
  62. such as NFS, NetWare, Lan Manager and so on. I think my description of source
  63. to object is clear enough (for people). If we use FTP LIST then we can make
  64. client and server yield the same user-level timestamps, but there will be
  65. shifts from TZ change effects.
  66.     Joe D.